require("../css/sportsDetail.less")
require('../fonts/iconfont.css')

document.ready(function () {
    let id = location.search.split("?id=").join("")

    // //获取用户消息
    let user = JSON.parse(localStorage.getItem('user'))

    // let Url = 'http://139.9.177.51:8099'
    // //获取节点
    //获取训练课程详情
    $http.get('/sports/courseDetail?id=' + id, function (res) {
        //获取节点
        let title = document.querySelector(".title")
        let brief = document.querySelector(".brief")
        //渲染标题文本内容
        title.textContent = res.data.name
        brief.textContent = res.data.desc
        let videoList = res.data.fragments;
        localStorage.setItem('videoList', JSON.stringify(videoList));
    })

    //开始训练按钮跳转
    let star = document.querySelector(".star")
    star.addEventListener('click', function () {
        location.href = "../page/video.html"

    })


    let go = document.querySelector('.go')
    go.addEventListener('click',function(ev){
        location.href = "../page/video.html"
    })


    let back = document.querySelector('.back')
    back.addEventListener('click',function(ev){
        ev.stopPropagation()
        location.href = "../page/sports.html"
    })



})